// src/router/index.js
import VueRouter from 'vue-router'
import Vue from 'vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/', 
    redirect: '/login'
  },
  {
    path: '/login', 
    component: () => import('@/views/LoginForm.vue'), 
    name: 'LoginForm'
  },
  {
    path: '/dashboard', 
    component: () => import('@/components/Dashboard.vue'), 
    name: 'Dashboard',
    children: [
      {
        path: 'faq-management', 
        component: () => import('@/components/FaqManagement.vue'), 
        name: 'FaqManagement'
      },
      {
        path: 'article-management',
        component: () => import('@/components/ArticleManagement.vue'),
        name: 'ArticleManagement'
      },
      {
        path: 'article-type-management',
        component: () => import('@/components/ArticleTypeManagement.vue'),
        name: 'ArticleTypeManagement'
      },
      {
        path: 'article-edit',
        component: () => import('@/components/ArticleEdit.vue'),
        name: 'ArticleEdit'
      },
      {
        path: 'article-edit/:id',
        component: () => import('@/components/ArticleEdit.vue'),
        name: 'ArticleEditWithId'
      },
      {
        path: 'recruitment-plan',
        component: () => import('@/views/RecruitmentPlan.vue'),
        name: 'RecruitmentPlan'
      },
      
      {
        path: 'score-data-management',
        component: () => import('@/components/ScoreDataManagement.vue'),
        name: 'ScoreDataManagement'
      },
      {
        path: 'basic-info-management',
        component: () => import('@/components/BasicInfoManagement.vue'),
        name: 'BasicInfoManagement'
      },
      {
        path: 'department-management',
        component: () => import('@/components/DepartmentManagement.vue'),
        name: 'DepartmentManagement'
      },
      {
        path: 'major-management',
        component: () => import('@/components/MajorManagement.vue'),
        name: 'MajorManagement'
      },
      {
        path: 'banner-management',
        component: () => import('@/components/BannerManagement.vue'),
        name: 'BannerManagement'
      }
    ]
  }
]

const router = new VueRouter({ mode: 'history', routes: routes })


export default router